<!--  -->
<template>
  <el-form :label-width="formLabelWidth">
    <el-form-item :label="title" style="margin-bottom:0px;">
      <el-color-picker style="top:7px;" size="mini" v-model="color"></el-color-picker>
      <span v-if="info" class="span-u">{{info}}</span>
    </el-form-item>
  </el-form>
</template>

<script>
export default {
  mounted () {
    this.color = this.defValue
  },
  props: {
    formLabelWidth: {
      type: String,
      default: '120px'
    },
    defValue: {
      type: String
    },
    chgValue: {
      type: Function
    },
    title: {
      type: String,
      default: '字体颜色'
    },
    info: {
      type: String,
      default: ''
    }
  },
  data () {
    return {
      color: ''
    }
  },
  watch: {
    color: {
      handler () {
        this.chgValue(this.color)
      },
      deep: true
    }
  }
}

</script>
<style scoped>
.span-u{
  margin-left:10px;
  font-size:12px;
  color:#999;
  margin-top: -5px;
  display: inline-block;
  vertical-align: middle;
}
</style>
